<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script th:src="@{/lib/layui/layui.js}" charset="utf-8"></script>
</head>
<body>
<form class="layui-form"  th:action="@{/tea/exam/topic/addsubmit}">
    <div class="layui-form-item">
        <label class="layui-form-label">试卷名称</label>
        <div class="layui-input-inline">
            <input type="text" name="name" required  lay-verify="required" placeholder="第三章单元测试" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">参加考试的班级</label>
        <div class="layui-input-inline">
            <select name="class_id" lay-verify="required">
                <option value=""></option>
                <option th:each="class:${Allclass}" th:value="${class.getId()}" th:text="${class.getClass_name()}"></option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">考试截至日期</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" name="deadline" lay-verify="required" id="test1" placeholder="yyyy-MM-dd HH-mm">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit type="submit">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>

</body>
<script>
    //Demo
    layui.use('form', function(){
        var form = layui.form;

    });

    $(document).ready(function () {
        layui.use('laydate', function(){
            var laydate = layui.laydate;

            //执行一个laydate实例
            laydate.render({
                elem: '#test1'
                ,type: 'datetime'//指定元素
            });
        });
    })
</script>
</html>